using System;
using System.Collections;
using System.Collections.Generic;
using System.Xml.Schema;
using UnityEngine;
using UnityEngine.AddressableAssets;

namespace Hydrogen.MarkovChain
{
    public abstract class ResourceManager:IDisposable
    {
        protected T Load<T>(string addr) where T : UnityEngine.Object
        {
            var handle = Addressables.LoadAssetAsync<T>(addr);
            handle.WaitForCompletion();
            if (handle.Result) return handle.Result;
            Addressables.Release(handle.Result);
            return null;
        }

        public abstract void Dispose();
    }
}